home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / NextAnswers / 1172_get_textfield_in_text_delegate.rtf < prev    next >
Text File  |  1995-06-12  |  1KB  |  24 lines

  1. {\rtf0\ansi{\fonttbl\f0\fnil Times-Roman;\f2\fmodern Courier;\f1\fmodern Ohlfs;}
  2. \paperw13520
  3. \paperh9880
  4. \margl120
  5. \margr120
  6. {\colortbl;\red0\green0\blue0;\red84\green84\blue84;}
  7. \pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f0\b0\i0\ulnone\fs28\fc0\cf0 Q:  How can I determine which TextField is being edited, while performing a delegate method such as textWillEnd: or textDidChange:?\
  8. \
  9. A: All of TextField's delegate methods send the Text object as an argument.  You can message this Text object to get 
  10. \i its
  11. \i0  delegate, which has been set to the id of the TextField being edited. If you have several TextFields in a Matrix (or a Form) then the Matrix (or the Form) is the delegate of the Text object. In which case you should use the following method calls to get the actual TextField:\
  12. \
  13.  
  14. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f2\fs24\fc1\cf1     [[sender delegate] selectedCell];\
  15.  
  16. \pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f0\fs28\fc0\cf0     \
  17. This code also works for individual TextFields, because single Controls return self when asked for selectedCell.  We recommend that you use the above code snippet in all cases.\
  18. \
  19. QA507\
  20.     \
  21. Valid for 1.0, 2.0, 3.0\
  22. \
  23.  
  24.